package com.guojizhuang.join;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class ShopMapper extends Mapper<LongWritable, Text, LongWritable,Text> {
    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {

        String[] stuAttr = value.toString().split(",");

        for(String s:stuAttr[2].split(":"))
        {
            context.write(new LongWritable(Long.parseLong(s)),new Text("shop:"+stuAttr[0]));
        }
    }
}
